<%@ page language="java" pageEncoding="ISO-8859-1"%>

<%@ taglib prefix="s" uri="/struts-tags"%>

<s:fielderror cssClass="note-red"/>
<s:actionerror cssClass="note-red"/>
<s:actionmessage cssClass="verdana11greynormal"/>

<table width="100%">
	<tr>
		<td height="40" class="sectionheading bottom-border">
			Manage Letters
		</td>
	</tr>
	<tr>
		<td height="8">
		</td>
	</tr>
	<tr>
		<td>
			<s:form method="post" action="getLetterInformation.htm" theme="simple"
				name="Mailing_Letters">

				<table width="100%">
					<tr>
						<td align="right" width="25%" class="verdana12blacknormal">
							Current Letters:
						</td>
						<td valign="top" width="55%">
							<s:select value="%{letter.letterId}" name="letter.letterId"
								theme="simple" list="letters" headerKey="0"
								listValue="subject" cssClass="Textfiled-border"
								headerValue="--- Select Letter ---" listKey="letterId"></s:select>
							<s:hidden name="action" id="action" />
						</td>
						<td valign="top" width="10%">
							<s:a href="#" cssClass="navi-link"
								onclick="document.Mailing_Letters.action.value='Edit_Letter'; document.Mailing_Letters.submit(); return false;">View / Edit
							</s:a>
						</td>
						<td valign="top" width="10%">
							<img src="../Admin-Images/delete_btn.gif"
								onclick="document.Mailing_Letters.action.value='Delete_Letter'; document.Mailing_Letters.submit(); return false;" />
						</td>
					</tr>
				</table>
			</s:form>
		</td>
	</tr>
	<tr>
		<td>
			<s:form method="post" action="insertOrUpdateLetter.htm" theme="simple"
				name="Edit_Mailing_Letters" id="form">

				<table border="0" cellpadding="2" cellspacing="2" width="100%">
					<tbody>
						<tr>
							<td colspan="2" align="center" width="100%" class="verdana12darkgreybold">
								Edit Letter
							</td>
						</tr>

						<tr>
							<td align="right" nowrap="nowrap" width="25%" class="verdana12blacknormal">
								Subject:
							</td>
							<td>
								<s:textfield theme="simple" name="letter.subject" cssClass="Textfiled-border"
									value="%{letter.subject}" size="65" />
							</td>
						</tr>

						<tr>
							<td align="right" valign="top" class="verdana12blacknormal">
								Message:
							</td>
							<td>
								<s:textarea theme="simple" rows="12" cols="50" cssClass="Textfiled-border"
									name="letter.message" value="%{letter.message}"></s:textarea>
							</td>

						</tr>

						<tr>
							<td colspan="2" align="center" nowrap="nowrap">
								<s:submit theme="simple" name="Save Letter" type="image" src="../Admin-Images/save-letter-btn.gif" value="Save Letter"></s:submit>
								<img style="cursor: pointer;" onclick="document.getElementById('form').reset();" src="../Admin-Images/reset-button.gif" alt="Reset">
							</td>
						</tr>
				</table>
				<s:hidden value="%{letter.letterId}" name="letter.letterId" />
			</s:form>
		</td>
	</tr>
</table>